import gameCamera from './camera'

class GameScene {
    constructor() {
        this.instance = null
    }

    init() {
        this.instance = new THREE.Scene()
        this.renderer = new THREE.WebGLRenderer({
            canvas: canvas,
            aitialias: true, // 抗锯齿
            preserveDrawingBuffer: true // 开启缓冲
        })

        this.gameCamera = gameCamera
        this.gameCamera.init()

        const axesHelper = new THREE.AxesHelper(100)
        this.instance.add(axesHelper)
        this.instance.add(this.gameCamera.instance)
    }

    render() {
        this.renderer.render(this.instance, this.gameCamera.instance)
    }
}

export default new GameScene()